1. Field of the Invention
The present invention relates to layer 2 and layer 3 switching of data packets in cascaded non-blocking network switches configured for switching data packets between subnetworks.
2. Background Art
Local area networks use a network cable or other media to link stations on the network. Each local area network architecture uses a media access control (MAC) enabling network interface devices at each network node to access the network medium.
The Ethernet protocol IEEE 802.3 has evolved to specify a half-duplex media access mechanism and a full-duplex media access mechanism for transmission of data packets. The full-duplex media access mechanism provides a two-way, point-to-point communication link between two network elements, for example between a network node and a switched hub.
Switched local area networks are encountering increasing demands for higher speed connectivity, more flexible switching performance, and the ability to accommodate more complex network architectures. For example, commonly-assigned U.S. Pat. No. 5,953,335 discloses a network switch configured for switching layer 2 type Ethernet (IEEE 802.3) data packets between different network nodes; a received data packet may include a VLAN (virtual LAN) tagged frame according to IEEE 802.1q protocol that specifies another subnetwork (via a router) or a prescribed group of stations. Since the switching occurs at the layer 2 level, a router is typically necessary to transfer the data packet between subnetworks.
Efforts to enhance the switching performance of a network switch to include layer 3 (e.g., Internet protocol) processing may suffer serious drawbacks, as current layer 2 switches preferably are configured for operating in a non-blocking mode, where data packets can be output from the switch at the same rate that the data packets are received. Newer designs are needed to ensure that higher speed switches can provide both layer 2 switching and layer 3 switching capabilities for faster speed networks such as 100 Mbps or gigabit networks.
However, such design requirements risk loss of the non-blocking features of the network switch, as it becomes increasingly difficult for the switching fabric of a network switch to be able to perform layer 3 processing at the wire rates (i.e., the network data rate). In addition, efforts to add layer 3 processing to a network switch may result in additional problems, especially if multiple switches are cascaded in an attempt to increase switching capacity.
One such problem involves the looping of a data packet addressed to a different subnetwork. In particular, FIG. 1 illustrates one possible network arrangement, where network switches 2a and 2b are interconnected by an expansion bus 4. The network switch 2a has network switch ports coupled to respective subnetworks 6a and 6b, and a router 8. The network switch 2b has network switch ports coupled to the respective subnetworks 6c and 6d. 
Each network switch 2 typically is configured to include layer 3 (e.g., IP) addresses only for host stations that are directly connected to the corresponding switch, such that the switch 2a would store the layer 3 addresses for only the host stations in the subnetwork 6a or 6b, and the switch 2b would store the layer 3 addresses for only the host stations in the subnetwork 6c or 6d. Consequently, if a host station in subnetwork 6a output a data packet that specifies a destination IP address of a host station in the subnetwork 6d, the switch 2a would forward the data packet having the unknown destination IP addresses to the router 8. However the router 8, upon determining that the destination station is reachable via the switch 2a, would forward the data packet back to the switch 2a, creating a loop between the router 8 and the switch 2a. 
Although the above-described looping problem can be eliminated by adding within each network switch 2 the layer 3 addresses of all host stations that are reachable by that network switch 12 (e.g., adding layer 3 addresses for host stations in subnetworks 6c or 6d into the address table of the network switch 2a), the substantially large number of network stations would quickly overwhelm the memory capacity of the address tables within each switch, requiring a substantially large memory.
There is a need for an arrangement that enables a network switch to provide layer 2 switching and layer 3 switching capabilities between cascaded network switches serving different subnetworks, without looping of data packets between the network switch and a router.
There is also a need for an arrangement that enables cascaded network switches to provide layer 2 switching and layer 3 switching with minimal transfer of data packets to a router.
These and other needs are attained by the present invention, where a network switch includes a switching module and network switch ports connecting respective subnetworks. The switching module includes a plurality of address tables for storing address information (e.g., layer 2 and layer 3 address and switching information), where at least one table is configured for storing subnetwork identifiers of subnetworks that are reachable by the network switch.
One aspect of the present invention provides a method in a network switch coupled to a first group of subnetworks and a second network switch, where the second network switch is coupled to a second group of subnetworks. The method includes receiving from a host station in the first group of subnetworks a layer 2 packet having layer 3 destination information having a destination network identifier, a destination subnetwork identifier, and a destination host identifier, the destination subnetwork identifier identifying a destination subnetwork for the layer 2 packet. The method also includes searching for the destination subnetwork identifier in a table, having stored subnetwork identifiers specifying subnetworks reachable by the network switch via respective specified output ports, and forwarding the layer 2 packet to an identified one of the specified output ports based on locating the destination subnetwork identifier within the table. Searching for the destination subnetwork identifier in a table and forwarding the layer 2 packet based on locating the destination subnetwork identifier within the table enables the network switch to locate subnetworks that are remotely reachable, for example via other network switches via an expansion port, without unnnecessarily populating the address tables with individual IP addresses of host stations. Hence, layer 3 switching can be implemented in a network switch, without concern of looping between the network switch and a router.
Another aspect of the present invention provides a network switch. The network switch includes a plurality of network switch ports, each configured for receiving data packets from a corresponding connected subnetwork having a corresponding subnetwork identifier. The network switch also includes an expansion port configured for transferring data packets between the network switch and a second network switch serving another group of subnetworks, and switching logic. The switching logic includes a subnetwork table having table entries, each table entry having a stored subnetwork identifier specifying a subnetwork reachable by the network switch and a corresponding port identifier that specifies one of the network switch ports and the expansion port for reaching the corresponding subnetwork, the switching logic selecting a destination port for one of a destination subnetwork and a router based on a locating a layer 3 destination subnetwork identifier of a received data packet in the subnetwork table.
Additional advantages and novel features of the invention will be set forth in part in the description which follows and in part will become apparent to those skilled in the art upon examination of the following or may be learned by practice of the invention. The advantages of the present invention may be realized and attained by means of instrumentalities and combinations particularly pointed in the appended claims.